<?php
/**
 * Created by PhpStorm.
 * User: gaochaolyf
 * Date: 16/5/23
 * Time: 下午3:02
 */

namespace api\Model;

use Think\Model;

class SlideContentModel extends Model
{
    function __construct() {
        $this->model = M('SlideContent');
    }

    public function getSlideContentList($field = array('*'), $condition = array(), $page = 1, $pergage = 10, $order = 'sort asc') {
        $data = $this->model->where($condition)->field($field)->page($page, $pergage)->order($order)->select();
        $data = $data ? $data : array();
        return $data;
    }

    public function getOneSlideContent($field = array('*'), $condition = array()) {
        $data = $this->model->where($condition)->field($field)->find();
        $data = $data ? $data : array();

        return $data;
    }
}